from xadmin.models import Templates
from django.forms import ModelForm


class TemplatesForm(ModelForm):
    class Meta:
        model = Templates
        exclude = ('site', )

    def __init__(self, *args, **kwargs):
        super(TemplatesForm, self).__init__(*args, **kwargs)
        for field_name in self.fields:
            field = self.fields[field_name]
            field.widget.attrs.update({'class': 'form-control'})